import React, { Component } from 'react';
import Taro from '@tarojs/taro';
import { View, Text, Button, Image, } from '@tarojs/components';
import { Cell, Icon } from '@antmjs/vantui';
import { stringifyUrl } from 'query-string';
import "./index.scss"

class WalletHome extends Component {

  config = {
    navigationBarTitleText: ''
  }

  state = {
    userInfo: {}
  }

  componentWillMount() {

  }
  componentDidMount() { }
  componentWillReceiveProps(nextProps, nextContext) { }
  componentWillUnmount() { }

  onbackList() {
    Taro.navigateBack();
  }


  render() {

    const renderLeftArea = ({ iconName, name }) => {
      return (

        <View className='left-area'>
          <Image src={require(`@/assets/icons/wallet/${iconName}.svg`)} style={{ width: 20, height: 20 }} />
          <View className='title'>{name}</View>
        </View>
      )
    }

    const { statusBarHeight, } = Taro.getSystemInfoSync()



    return (
      <View className='page'>
        <View className='nav' style={{ marginTop: statusBarHeight }}>
          <View className='nav-back' onClick={() => this.onbackList()} >
            <Icon color='red' name={require("@/assets/icons/public/nav_back_white.svg")} style='height:24px;width:24px;'></Icon>
          </View>
          <View className='nav_right' ></View>
        </View>
        <View className='page-top' style={{ marginTop: statusBarHeight + 44 + 8, }}>
          <Text className='title'>道以盾</Text>
          <Text className='desc'>已加密保护的隐私数据</Text>
        </View>
        <View className='page-list'>
          <Cell renderTitle={renderLeftArea({ iconName: 'wallet_list_realname', name: '实名信息' })} titleStyle={{ fontSize: '16px' }} border isLink linkType='navigateTo' url={stringifyUrl({ url: `/wallet/realName/index`, query: {} }, { encode: false })} />
          <Cell renderTitle={renderLeftArea({ iconName: 'wallet_list_ei', name: '合格投资者认证' })} titleStyle={{ fontSize: '16px' }} border isLink linkType='navigateTo' url={stringifyUrl({ url: `/pages/eligible_investors/index?isJG=0`, query: {} }, { encode: false })} />
          <Cell renderTitle={renderLeftArea({ iconName: 'wallet_list_authmanage', name: '机构授权管理' })} titleStyle={{ fontSize: '16px' }} border isLink linkType='navigateTo' url={stringifyUrl({ url: `/wallet/authMange/index`, query: {} }, { encode: false })} />
          <Cell renderTitle={renderLeftArea({ iconName: 'wallet_list_piur', name: '个人信息使用记录' })} titleStyle={{ fontSize: '16px' }} border isLink linkType='navigateTo' url={stringifyUrl({ url: `/wallet/personInfoUseRecord/index`, query: {} }, { encode: false })} />
        </View>
      </View>
    );
  }
}

export default WalletHome;
